<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>注册</title>
    <link rel="shortcut icon" href="./favicon.ico" type="image/x-icon">
    <link rel="stylesheet" href="http://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" />
    <link href="http://cdn.bootcss.com/font-awesome/4.6.3/css/font-awesome.min.css" rel="stylesheet">
    <link rel="stylesheet" href="./css/css.css">
    <link rel="stylesheet" href="./css/upload.css">
    <link rel="stylesheet" href="./css/style.css">

    <script src="http://cdn.bootcss.com/jquery/3.1.1/jquery.min.js"></script>
    <script src="http://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
    <script src="./js/myjs.js"></script>
    <script src="http://cdn.bootcss.com/masonry/4.1.1/masonry.pkgd.min.js"></script>
</head>
<body>
<div class="container">
    <div class="row">
        <div class="col-md-offset-3 col-md-6">
            <form class="form-horizontal" id="placeOrderForm" onsubmit="return false">
                <span class="heading">租赁床位</span>
                <div class="form-group">
                    <div class="input-group">
                        <span class="input-group-addon" id="basic-addon3">床位</span>
                        <input type="text" class="form-control" value="FC012322M3M434F" readonly="readonly">
                    </div>
                </div>
                <input type="hidden" class="form-control" id="bedId" name="bedId" value="1">

                <div class="form-group">
                    <div class="input-group">
                        <span class="input-group-addon" id="basic-addon3">医院</span>
                        <input type="text" class="form-control" value="凤城医院"  readonly="readonly">
                    </div>
                </div>
                <input type="hidden" class="form-control" id="hospitalId" name="hospitalId" value="2">

                <div class="form-group">
                    <div class="input-group">
                        <span class="input-group-addon" id="basic-addon3">科室</span>
                        <input type="text" class="form-control" value="儿科"  readonly="readonly">
                    </div>
                </div>
                <input type="hidden" class="form-control" id="deptId" name="deptId" value="6">

                <div class="form-group">
                    <div class="input-group">
                        <span class="input-group-addon" id="basic-addon3">类型</span>
                        <input type="text" class="form-control" value="时租"  readonly="readonly">
                    </div>
                </div>
                <input type="hidden" class="form-control" id="orderTypeId" name="orderTypeId" value="2">

                <div class="form-group">
                    <div class="input-group">
                        <span class="input-group-addon" id="basic-addon4">时长</span>
                        <input type="text" class="form-control" id="orderUseTime" name="orderUseTime" value="8"  readonly="readonly">
                    </div>
                </div>
                <div class="form-group">
                    <button type="submit" class="btn btn-default" onclick="placeOrder()">确认下单</button>
                </div>
            </form>
        </div>
    </div>
</div>

<script>
    function placeOrder() {
        $.ajax({
            url:"/order/placeOrder",
            data: $("#placeOrderForm").serialize(),
            method: "get",
            dataType: "json",
            success: function (data) {
                if (data.result === true) {
                    window.location="/placeordersuccess.html";
                } else {
                    alert(data.errorMsg);
                }
            }
        });
    }
</script>
</body>
</html>
